package com.joolun.mall.util;

import com.joolun.common.utils.StringUtils;
import com.joolun.mall.entity.UserAddress;
import lombok.experimental.UtilityClass;

import java.util.Objects;

/**
 * @author quyang
 * @description
 * @date 2022/1/2
 */
@UtilityClass
public class AddressUtil {

    /**
     * 获取完整地址
     * @param address
     * @return
     */
    public String getFullAddressString(UserAddress address) {
        String fullAddressString = StringUtils.EMPTY;
        if (Objects.nonNull(address)) {
            fullAddressString = fullAddressString
                    + address.getProvinceName()
                    + address.getCityName()
                    + address.getCountyName()
                    + address.getDetailInfo();
        }
        return fullAddressString;
    }
}
